from datetime import datetime

from django.db import models


# Create your models here.
# pip install mysqlclient,Pillow 先安装

# python manage.py makemigrations 每次更改表就在项目根目录下执行一边遍(生成数据库对接文件)
# python manage.py migrate（对接数据库）
class user(models.Model):
    """基本用户数据"""
    username = models.CharField(max_length=64, unique=True, verbose_name="用户名")
    acc = models.CharField(max_length=11, unique=True, verbose_name="账号")
    pwd = models.CharField(max_length=64, unique=False, verbose_name="密码")
    num = models.IntegerField(default=0, verbose_name="学号", unique=True)
    add_data = models.DateTimeField(default=datetime.now, unique=False, verbose_name="创建时间")
    is_delete = models.BooleanField(default=False, verbose_name="状态")
    openid = models.IntegerField(verbose_name="openid")

    class Meta:
        db_table = "userinfo"
